package com.sc.sc250601.cook.mapper;

import com.sc.sc250601.cook.pojo.Recipe;

import java.util.List;

public interface RecipeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Recipe record);

    int insertSelective(Recipe record);

    Recipe selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Recipe record);

    int updateByPrimaryKeyWithBLOBs(Recipe record);

    int updateByPrimaryKey(Recipe record);
    //周推荐
    List<Recipe> weekTop();
    //周推荐2
    List<Recipe> weekTop2();
    //根据id获取菜谱，带用户信息
    List<Recipe> selectByIdsWithUser(List<Long> ids);
    //昨日收藏榜
    List<Recipe> favoriteTop();
    // 根据菜谱类型或名字获取菜谱
    List<Recipe> getRecipesByType(String type);
    //根据用户id推荐类似菜谱
    List<Recipe> selectRecipeByUserId(Long userId);
    //查询所有的菜谱（未登录）
    List<Recipe> selectAllRecipe();

    //点击菜谱浏览数加1
    int updateViewCount(Long id);

    // 帖子收藏次数-1
    int updateFavoriteCountDecrease(Long id);
    // 对应帖子收藏次数+1
    int updateFavoriteCountIncrease(Long id);

    Recipe selectOneRecipeWithUser(Long id);
}